class TestShape {
    public class Point{
        private double x;
        private double y;
        public Point(double x,double y){
            this.x=x;
            this.y=y;
            System.out.println("构建"+name);
        }
        public double getY() {
            return y;
        }
        public double getX() {
            return x;
        }
    }
    private String name;
    private  Point points[];
    private  int pointCount;
    public TestShape(String name){
        this.name=name;
        points=new Point[10];
        pointCount=0;
    }

    public String getName() {
        return name;
    }

    public void addPoint(double x,double y) {
     if(pointCount<points.length){
         Point point=new Point(x,y);
         points[pointCount++]=point;
     }else{
         System.out.println("数组已满，无法添加更多点");
     }
    }
    public void printPoints(){
        for(int i=0;i<pointCount;i++){
            Point point=points[i];
            System.out.println("("+point.getX()+","+point.getY()+ ")");
        }
    }
}
public class Main {
    public static void main(String[] args) {
TestShape s1=new TestShape("圆");
        s1.addPoint(10,10);
        s1.addPoint(10,20);
        s1.printPoints();
    }
}